<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.5"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>FreeRTOS Addons: cpp_freertos::WorkQueue Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">FreeRTOS Addons
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.5 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespacecpp__freertos.html">cpp_freertos</a></li><li class="navelem"><a class="el" href="classcpp__freertos_1_1_work_queue.html">WorkQueue</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classcpp__freertos_1_1_work_queue-members.html">List of all members</a>  </div>
  <div class="headertitle"><div class="title">cpp_freertos::WorkQueue Class Reference</div></div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;<a class="el" href="workqueue_8hpp_source.html">workqueue.hpp</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a7dc1ee3362db2c09950b650d5e589297"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__freertos_1_1_work_queue.html#a7dc1ee3362db2c09950b650d5e589297">WorkQueue</a> (const char *const Name, uint16_t StackDepth=DEFAULT_WORK_QUEUE_STACK_SIZE, UBaseType_t Priority=DEFAULT_WORK_QUEUE_PRIORITY, UBaseType_t MaxWorkItems=DEFAULT_MAX_WORK_ITEMS)</td></tr>
<tr class="separator:a7dc1ee3362db2c09950b650d5e589297"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab2c3d871665f0610fbbfd5fb9198180d"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__freertos_1_1_work_queue.html#ab2c3d871665f0610fbbfd5fb9198180d">WorkQueue</a> (uint16_t StackDepth=DEFAULT_WORK_QUEUE_STACK_SIZE, UBaseType_t Priority=DEFAULT_WORK_QUEUE_PRIORITY, UBaseType_t MaxWorkItems=DEFAULT_MAX_WORK_ITEMS)</td></tr>
<tr class="separator:ab2c3d871665f0610fbbfd5fb9198180d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a341c2a161e90ab3e474e22505fff7216"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__freertos_1_1_work_queue.html#a341c2a161e90ab3e474e22505fff7216">~WorkQueue</a> ()</td></tr>
<tr class="separator:a341c2a161e90ab3e474e22505fff7216"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9a7475df5d36aaddac4a2f43adbe67a8"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__freertos_1_1_work_queue.html#a9a7475df5d36aaddac4a2f43adbe67a8">~WorkQueue</a> ()=delete</td></tr>
<tr class="separator:a9a7475df5d36aaddac4a2f43adbe67a8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a910c0f04137a2778af6653bdb40c12e7"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcpp__freertos_1_1_work_queue.html#a910c0f04137a2778af6653bdb40c12e7">QueueWork</a> (<a class="el" href="classcpp__freertos_1_1_work_item.html">WorkItem</a> *work)</td></tr>
<tr class="separator:a910c0f04137a2778af6653bdb40c12e7"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p >This class is the "engine" for WorkItems. Create one or more WorkQueues to accept WorkItems. WorkQueues pull WorkItems off of a FIFO queue and run them sequentially. </p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a7dc1ee3362db2c09950b650d5e589297" name="a7dc1ee3362db2c09950b650d5e589297"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7dc1ee3362db2c09950b650d5e589297">&#9670;&#160;</a></span>WorkQueue() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">WorkQueue::WorkQueue </td>
          <td>(</td>
          <td class="paramtype">const char *const&#160;</td>
          <td class="paramname"><em>Name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>StackDepth</em> = <code>DEFAULT_WORK_QUEUE_STACK_SIZE</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">UBaseType_t&#160;</td>
          <td class="paramname"><em>Priority</em> = <code>DEFAULT_WORK_QUEUE_PRIORITY</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">UBaseType_t&#160;</td>
          <td class="paramname"><em>MaxWorkItems</em> = <code>DEFAULT_MAX_WORK_ITEMS</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p >Constructor to create a named <a class="el" href="classcpp__freertos_1_1_work_queue.html">WorkQueue</a>.</p>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname">ThreadCreateException,<a class="el" href="classcpp__freertos_1_1_queue_create_exception.html">QueueCreateException</a>,<a class="el" href="classcpp__freertos_1_1_semaphore_create_exception.html">SemaphoreCreateException</a></td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">Name</td><td>Name of the thread internal to the <a class="el" href="classcpp__freertos_1_1_work_queue.html">WorkQueue</a>. Only useful for debugging. </td></tr>
    <tr><td class="paramname">StackDepth</td><td>Number of "words" allocated for the <a class="el" href="classcpp__freertos_1_1_thread.html">Thread</a> stack. </td></tr>
    <tr><td class="paramname">Priority</td><td>FreeRTOS priority of this <a class="el" href="classcpp__freertos_1_1_thread.html">Thread</a>. </td></tr>
    <tr><td class="paramname">MaxWorkItems</td><td>Maximum number of WorkItems this <a class="el" href="classcpp__freertos_1_1_work_queue.html">WorkQueue</a> can hold. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ab2c3d871665f0610fbbfd5fb9198180d" name="ab2c3d871665f0610fbbfd5fb9198180d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab2c3d871665f0610fbbfd5fb9198180d">&#9670;&#160;</a></span>WorkQueue() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">WorkQueue::WorkQueue </td>
          <td>(</td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>StackDepth</em> = <code>DEFAULT_WORK_QUEUE_STACK_SIZE</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">UBaseType_t&#160;</td>
          <td class="paramname"><em>Priority</em> = <code>DEFAULT_WORK_QUEUE_PRIORITY</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">UBaseType_t&#160;</td>
          <td class="paramname"><em>MaxWorkItems</em> = <code>DEFAULT_MAX_WORK_ITEMS</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p >Constructor to create an unnamed <a class="el" href="classcpp__freertos_1_1_work_queue.html">WorkQueue</a>.</p>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname">ThreadCreateException,<a class="el" href="classcpp__freertos_1_1_queue_create_exception.html">QueueCreateException</a>,<a class="el" href="classcpp__freertos_1_1_semaphore_create_exception.html">SemaphoreCreateException</a></td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">StackDepth</td><td>Number of "words" allocated for the <a class="el" href="classcpp__freertos_1_1_thread.html">Thread</a> stack. </td></tr>
    <tr><td class="paramname">Priority</td><td>FreeRTOS priority of this <a class="el" href="classcpp__freertos_1_1_thread.html">Thread</a>. </td></tr>
    <tr><td class="paramname">MaxWorkItems</td><td>Maximum number of WorkItems this <a class="el" href="classcpp__freertos_1_1_work_queue.html">WorkQueue</a> can hold. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a341c2a161e90ab3e474e22505fff7216" name="a341c2a161e90ab3e474e22505fff7216"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a341c2a161e90ab3e474e22505fff7216">&#9670;&#160;</a></span>~WorkQueue() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">WorkQueue::~WorkQueue </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p >Our destructor.</p>
<dl class="section note"><dt>Note</dt><dd>Given the multithreaded nature of this class, the dtor may block until the underlying <a class="el" href="classcpp__freertos_1_1_thread.html">Thread</a> has had a chance to clean up. </dd></dl>

</div>
</div>
<a id="a9a7475df5d36aaddac4a2f43adbe67a8" name="a9a7475df5d36aaddac4a2f43adbe67a8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9a7475df5d36aaddac4a2f43adbe67a8">&#9670;&#160;</a></span>~WorkQueue() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">cpp_freertos::WorkQueue::~WorkQueue </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">delete</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p >If we can't delete a task, it makes no sense to have a destructor. </p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a910c0f04137a2778af6653bdb40c12e7" name="a910c0f04137a2778af6653bdb40c12e7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a910c0f04137a2778af6653bdb40c12e7">&#9670;&#160;</a></span>QueueWork()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool WorkQueue::QueueWork </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classcpp__freertos_1_1_work_item.html">WorkItem</a> *&#160;</td>
          <td class="paramname"><em>work</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p >Send a <a class="el" href="classcpp__freertos_1_1_work_item.html">WorkItem</a> off to be executed.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">work</td><td>Pointer to a <a class="el" href="classcpp__freertos_1_1_work_item.html">WorkItem</a>. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if it was queued, false otherwise. </dd></dl>
<dl class="section note"><dt>Note</dt><dd>This function may block if the <a class="el" href="classcpp__freertos_1_1_work_queue.html">WorkQueue</a> is presently full. </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>src/<a class="el" href="workqueue_8hpp_source.html">workqueue.hpp</a></li>
<li>src/freertos-addon/c++/cworkqueue.cpp</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.5
</small></address>
</body>
</html>
